package com.sj.purchase.modules.gy.domain;

import com.alibaba.fastjson.annotation.JSONField;

import javax.persistence.*;
import java.util.Collection;
import java.util.HashSet;

/**
 * Created by icodebug on 17-5-22.
 */
@Entity
public class GySpu {

    @JSONField(name = "code")
    @Id
    private String id;

    private String name;

    @JSONField(name = "gySkuSet")
    @OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
    private Collection<GySku> gyskus = new HashSet();

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Collection<GySku> getGyskus() {
        return gyskus;
    }

    public void setGyskus(Collection<GySku> gyskus) {
        this.gyskus = gyskus;
    }
}
